package com.odobenus.client.loader;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;

import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;
public class RefreshPropertySource extends MapPropertySource {
 
   
    public RefreshPropertySource(String name, Map<String, Object> source) {
        super(name, source);
    }
 
    public RefreshPropertySource() {
        super("RefreshPropertySource", new HashMap<String,Object>());
    }
 
    public void refresh(ConfigurableEnvironment environment) {
        this.source.put("spring.datasource.url", "123");
        environment.getPropertySources().addFirst(this);
    }
}